#ifndef SOCKETTCP_H
#define SOCKETTCP_H

#include <QObject>
#include <QtNetwork>

#include <QTextStream>
#include <qmessagebox.h>

class SocketTCP : public QObject
{
    Q_OBJECT

public:
    SocketTCP();
    ~SocketTCP();

    QTcpServer *generateServer(QString port);
    QTcpSocket *generateClient(QString ipServer, QString port);

private:
    QTcpServer      *server;
    QNetworkReply   *networkReply;

    void findIP();

public slots:
    void newConnect();
    void saveIP();
    void successClientConnect();

signals:
    void ipServer(QString);
    void info_tcp(QString);
    void newClient(QTcpSocket*);

};

#endif // SOCKETTCP_H
